package icu.d4peng.basic.captcha.controller;

import icu.d4peng.basic.captcha.service.CaptchaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * CaptchaController
 *
 * @author d4peng <a href="d4peng@qq.com">d4peng@qq.com</a>
 * @since 2023.12.03
 */
@RestController
public class CaptchaController {

	private final CaptchaService captchaService;

	@Autowired
	public CaptchaController(CaptchaService captchaService) {
		this.captchaService = captchaService;
	}

	@GetMapping("create")
	public void create() {
		this.captchaService.create();
	}

	@GetMapping("text")
	public Object toText() {
		return this.captchaService.toText();
	}

	@GetMapping("base64")
	public Object toBase64() {
		return this.captchaService.toBase64();
	}

}
